﻿namespace FactoryMethod
{
    internal class IdCardFactory : Factory
    {
        private List<string> owners = new();

        protected override Product CreateProduct(string owner)
        {
            return new IdCard(owner);
        }

        protected override void RegisterProduct(Product product)
        {
            owners.Add((product as IdCard)!.GetOwner());
        }

        public List<string> GetOwners() 
        {
            return owners;
        }
    }
}
